Replication code and data for �How the Reformulation of OxyContin Ignited the Heroin Epidemic� by William N. Evans, Ethan M.J. Lieber, and Patrick Power

Review of Economics and Statistics
Production Date: February, 2018

Programs used: Stata 14, Microsoft Excel, Microsoft Word

A number of the analyses depend on proprietary or restricted-use data. Information on how to obtain these data is provided below.

---------------------------------------------------------------------
Analysis .do files related to quadratic spline analysis
---------------------------------------------------------------------
-./do_files/Splines/arcos_other_drugs.do: produces Figure 7a and Tables 1, 2, and C1.
-./do_files/Splines/quadratic_spline_1.do: produces Figure 2 and Table 1
-./do_files/Splines/quadratic_spline_30_day_use_1.do: produces Figure 7c and Table 1
-./do_files/Splines/quadratic_spline_encounters_1.do: produces figure 7d and Table 1
-./do_files/Splines/quadratic_spline_rx_counts.do: produces Figure 7b and Table 1
-./do_files/Splines/sensitivity.do: produces Appendix Figure C2

---------------------------------------------------------------------
Analysis .do files related to heterogeneity analyses
---------------------------------------------------------------------
-./do_files/Risk_factors/risk_factors_1.do: used to break states into above/below median for our risk factors
-./do_files/Risk_factors/Run_high_low_d_s_3.do: produces Figures 3, 8, and 9 and results in Tables 3 and C1
-./do_files/Risk_factors/additional_analyses.do: produces Figures 10 and 12 and Tables 4, A1, B3, and B4.

---------------------------------------------------------------------
.do files for the raw CDC multiple cause of death data
---------------------------------------------------------------------
-./do_files/CDC/cdc_master.do: master file that runs CDC data-related tasks
-./do_files/CDC/read_in_data.do: read in raw CDC data for each year
-./do_files/CDC/combine_data.do: combine individual years of CDC data
-./do_files/CDC/drug_deaths.do: limits sample to drug poisoning deaths
-./do_files/CDC/make_ts_dataset.do: creates a dataset to be used for the time-series analyses and to create Figure 11
-./do_files/CDC/make_panel_dataset.do: creates a dataset at the state by year level
-./do_files/CDC/clean_vars.do: cleans up covariates used for Ruhm (2016) adjustment
-./do_files/CDC/predicting.do: implements Ruhm (2016) adjustment

---------------------------------------------------------------------
.do files for processing other data or producing other tables/figures
---------------------------------------------------------------------
-./do_files/Others/red_book_data.do: identifies oxycodone drugs in the Marketscan data
-./do_files/Others/county_oxy_rx_pay_2.do: gets prescriptions and prices for oxycodone in the Marketscan data (Figure 4)
-./do_files/Others/get_covered_months.do: gets the number of subscribers in the Marketscan data
-./do_files/Others/check_trends_other_drugs_2.do: produces Figures B1 and B2 as well as Table B2 
-./do_files/Others/count_inpatient_stays_2.do: counts heroin related inpatient stays in Marketscan data
-./do_files/Others/count_outpatients_1.do: counts heroin related outpatient visits in Marketscan data
-./do_files/Others/stack_out_in_2.do: combines inpatient and outpatient heroin encounters in Marketscan for use in the quadratic spline analysis
-./do_files/Others/read_urate_data_1.do: read raw BLS unemployment data and create state by month and state by quarter datasets
-./do_files/Others/read_seer_state_1.do: read raw SEER data and create annual state level demographics
-./do_files/Others/read_seer_data_turn_to_month.do: interpolates population variables to monthly values
-./do_files/Others/read_seer_data_turn_to_month.do: interpolates population variables to quarterly values
-./do_files/Others/collapse_qtr_means_1.do: estimate quarterly fraction of individuals who use pain medicine recreationally 
-./do_files/Others/read_ed_opioids_1.do: reads emergency department Florida hospital data and finds opioid encounters
-./do_files/Others/read_fl_hospital_2.do: reads inpatient Florida hospital data and finds opioid encounters; combine output from this and previous output file to identify which states are likely pill mill users
-./do_files/Others/ndhs_final1.do: reads in raw NSDUH data and cleans variables
-./do_files/Others/collapse_qtr_means_1.do: creates dataset of recreational pain medicine use

---------------------------------------------------------------------
Additional Figures/Tables
---------------------------------------------------------------------
Figure 1: Data were taken directly from the CDC Wonder Multiple Cause of death website at https://wonder.cdc.gov/mcd.html
Figure 5: This figure is based directly on the figure in the Drug Enforcement Administrations 2016 publication, "National Heroin Threat Assessment Summary--Updated." It is available online at https://www.dea.gov/divisions/hq/2016/hq062716_attach.pdf
Figure 6: This figure is created by combining the number of heroin uses (from cleaned NSDUH data) with the number of heroin deaths (from CDC data) in Excel
Table B2: Source materials for the events listed in this table are provided in the text


---------------------------------------------------------------------
Data 
---------------------------------------------------------------------
-Access to the restricted use CDC Multiple Cause of Death microdata can be gained via application to NAPHSIS. See https://www.naphsis.org/research-requests
-Marketscan data can be licensed from Truven Health Analytics
-Restricted use claims data for the state of Florida can be obtained from http://www.floridahealthfinder.gov/Researchers/OrderData/order-data.aspx
-Raw National Survey on Drug Use and Health data are available from ICPSR
-Demographics were from SEER (https://seer.cancer.gov/data/) and are included in the file seer_pop_month.dta and seer_pop_qtr.dta
-Quarterly ARCOS data were hand-gathered; the included datasets are opioids_together.dta and Evans_drugs_seven.dta
-Raw unemployment data are in la.data.3.AllStatesS.txt

